package data;

import java.io.IOException;
import java.util.Properties;

	public class ConnectionInfo {
		private String url, username, password, driver;
		
		public ConnectionInfo(String dataConfigFile){
			Properties props = new Properties();

			try {
				props.load(Connection.class.getClassLoader().getResourceAsStream(dataConfigFile));
				url = props.getProperty("databaseUrl");
				username = props.getProperty("username");
				password = props.getProperty("password");
				driver = props.getProperty("driver");
			} catch (IOException e) {
				System.out.println(e);
				e.printStackTrace();
			}
		}
		
		public String getUrl(){
			return this.url;
		}
		
		public String getUsername(){
			return this.username;
		}
		
		public String getPassword(){
			return this.password;
		}
		
		public String getDatabaseDriver(){
			return driver;
		}
	}